<div class="breadcrumb"><?php the_breadcrumb(); ?></div>
<?php do_vertical_space('10'); ?>
<h1 class="font-azul">Últimas Notícias</h1>
<?php //( in_category('Artigos') ) == 0)
do_vertical_space('15');
global $aux; 
$aux = 1;
$temp = $wp_query;
$wp_query= null;
$wp_query = new WP_Query();
$wp_query->query('category_name=noticias&posts_per_page=2'.'&paged='.$paged);
$postCount = 0;

while ($wp_query->have_posts()) : $wp_query->the_post();
$postCount = $postCount + 1;
	
    	if ($aux == 1) { ?>
			<div class="conteiner-noticia"> <?php 
				if ( has_post_thumbnail() ) { ?>
				<div style="width: 308px; float: left;">
					<div style="width: 308px; float: left;">
						<div style="float: left;"><?php the_post_thumbnail(); ?></div>
						<h2><a style="color: #008ad2;" href="<?php echo get_post_meta($post->ID, 'url', true); ?>" target="_blank"><?php the_title();?></a></h2>
						<?php do_vertical_space('3'); ?>
						<p class="data"><?php the_time(get_option('date_format')); ?></p>
					</div>
					<?php do_vertical_space('3'); ?>
					<div class="resumo">
						<a style="color:#020202;" href="<?php echo get_post_meta($post->ID, 'url', true); ?>"><?php the_excerpt(); ?></a>
					</div>
					<?php do_vertical_space('3'); ?>
					<div style="width: 308px; float: left;"><p class="fonte">Fonte: <?php echo get_post_meta($post->ID, 'fonte', true); ?></p></div>
					</div>
					
	    		<?php 
	    		} else { ?>
	    		<div style="width: 308px; float: left;">
					<div style="width: 308px; float: left;">
						<h2 style="margin: 0;"><a style="color: #008ad2;" href="<?php echo get_post_meta($post->ID, 'url', true); ?>" target="_blank"><?php the_title();?></a></h2>
						<?php do_vertical_space('3'); ?>
						<p class="data" style="margin: 0;"><?php the_time(get_option('date_format')); ?></p>
					</div>
					<?php do_vertical_space('3'); ?>
					<div class="resumo">
						<a style="color:#020202;" href="<?php echo get_post_meta($post->ID, 'url', true); ?>"><?php the_excerpt(); ?></a>
					</div>
					<?php do_vertical_space('3'); ?>
					<div style="width: 308px; float: left;"><p class="fonte">Fonte: <?php echo get_post_meta($post->ID, 'fonte', true); ?></p></div>
				</div>	 
					
				<?php    			
	    		}
	    		$aux = $aux+1; 	
    	} elseif ($aux == 2) { 
				if ( has_post_thumbnail() ) { ?>
				
				<div style="width: 308px; float: right;">
					<div style="width: 308px; float: right;">
						<div style="float: left;"><?php the_post_thumbnail(); ?></div>
						<h2><a style="color: #008ad2;" href="<?php echo get_post_meta($post->ID, 'url', true); ?>" target="_blank"><?php the_title();?></a></h2>
						<?php do_vertical_space('3'); ?>
						<p class="data"><?php the_time(get_option('date_format')); ?></p>
					</div>
					<?php do_vertical_space('3'); ?>
					<div class="resumo">
						<a style="color:#020202;" href="<?php echo get_post_meta($post->ID, 'url', true); ?>"><?php the_excerpt(); ?></a>
					</div>
					<?php do_vertical_space('3'); ?>
					<div style="width: 308px; float: left;"><p class="fonte">Fonte: <?php echo get_post_meta($post->ID, 'fonte', true); ?></p></div>
					</div>
	    		<?php 
	    		} else { ?>
					<div style="width: 308px; float: left;">
						<h2 style="margin: 0;"><a style="color: #008ad2;" href="<?php echo get_post_meta($post->ID, 'url', true); ?>" target="_blank"><?php the_title();?></a></h2>
						<?php do_vertical_space('3'); ?>
						<p class="data" style="margin: 0;"><?php the_time(get_option('date_format')); ?></p>
					</div>
					<?php do_vertical_space('3'); ?>
					<div class="resumo">
						<a style="color:#020202;" href="<?php echo get_post_meta($post->ID, 'url', true); ?>"><?php the_excerpt(); ?></a>
					</div>
					<?php do_vertical_space('3'); ?>
					<div style="width: 308px; float: left;"><p class="fonte">Fonte: <?php echo get_post_meta($post->ID, 'fonte', true); ?></p></div> 
				

				<?php    			
	    		}
	    		?>
			</div>
			<hr size="1" color= "#eaeaea" style="width: 300px; margin: auto; float: left;" />
			<hr size="1" color= "#eaeaea" style="width: 300px; margin: 0 10px 0 0; float: right;" />
		
		<?php 
		$aux = 1;		
        }
	endwhile; 
	if ( $postCount%2 == 1 ) { ?>
   				<div style="width: 300px; float: right;"></div>
			</div>		
    <?php 
	}

	
	?>	
<div class="clr"></div>
<?php do_vertical_space('10'); ?>
<?php 
//Faz a paginação do conteúdo
$url = get_bloginfo( 'url' );
$url = $url.'/noticias/';
pagination( $wp_query, $url );
?>

